package com.ktjy.config;

import com.ktjy.filter.WebInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lqm
 * @ClassName InterceptorConfig
 * @description: TODO
 */

//@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    /**
     * 添加自定义拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String[] path={"/user/list"};

        registry.addInterceptor(new WebInterceptor()).addPathPatterns(path);

    }
}
